package com.yt.demo.controller;

import org.apache.shiro.authz.annotation.RequiresGuest;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AuthorizationController {
    //验证角色
    @RequiresRoles("admin")
//    @RequiresUser
//    @RequiresGuest
    @RequestMapping("/check/rolse")
    public String checkRolse(){
        System.out.println("验证角色");
        return "验证角色";
    } //验证角色
    @RequiresPermissions("user:update")
    @RequestMapping("/check/perm")
    public String checkPermissions(){
        System.out.println("验证权限");
        return "验证权限";
    }
}
